草庐IT

angularjs - 未找到 Yeoman 指令模板

全部标签

javascript - 如何找到一个 widgetVar?

如果我有一个primefaces组件,比如...在html中,它会生成如下内容:...Alotofthingsinhere...$(function(){PrimeFaces.cw('SelectOneMenu','lollipop',.......在脚本标签内,您可以注意到小部件的变量名称(如果我没有在组件中提供它,它将被生成)。我想知道如何获取小部件var元素,或者如果这不可能,我如何获取该“”标签以便获取此小部件var的名称。------编辑------我将尝试解释为什么我需要这个。我有这个功能:functionsimulaTabManoBrow(event){varfocuse

javascript - 覆盖 $location pushState 历史 AngularJS

如果我是“结果页面”的返回用户,我想查看我使用的最后一个过滤器。所以我使用ngCookies来更新页面上最后使用的搜索参数。controller('Results',['$location','$cookies',function($location,$cookies){$location.search(angular.fromJson($cookies.search));}]);//willyield:/results?param1=dude¶m2=bro但是,如果我点击“返回”,我将不会被带到我期望的最后一页。那是因为另一个状态被插入了历史但用户没有察觉到。用户登陆/res

javascript - AngularJS - 从代码重定向到另一个域

我设置了一个plunker来描述我的问题:Plnkr实际上我想导航到另一个域中的另一个页面(向按钮单击添加一个处理程序)。但它不起作用。提前致谢。更新window.location.href="http://google.com";正在工作,但AngularJS默认的$location.absUrl服务不工作。 最佳答案 $location服务不允许重新加载页面。TheAngularwaytoperformaredirectiontoanotherdomainistousethe$windowservice:$window.loca

javascript - <head> 标签中的 Ember Handlebars 模板

ember(特别是应用程序模板)是否可以在head标签内运行,以便动态更改标题标签、元标签、外部css样式表和网站图标等内容?如果是这样,执行此操作的干净方法是什么? 最佳答案 为了完成这项工作,我所做的是创建Handlebars助手。例如,如果您想更改非常常见的View的标题,这里是帮助器。Ember.Handlebars.helper('headTitle',function(title){Ember.$('head').find('title').text(title);},'title');现在在任何View模板中你都可以添

javascript - AngularJS 从文件夹加载 Controller

我是AngularJS的新手,对如何从结构化文件夹加载Controller和其他js有疑问?例如我有结构:app/-common-users--userController.js--userService.js-orders-app.js我应该如何从文件夹用户加载Controller和服务?还有一个小问题:方形护腕是什么意思?app.config(['someThing'],function($routeProvider) 最佳答案 您可以将代码放在您想要的位置。如果将它们放入Angular模块中,Angular会找到它。所以如果你

javascript - 单击 "Apply"按钮后应用 angularjs 过滤器

我有一个很大的数据列表(4000多个项目)。开始输入时-我的浏览器卡住(最多15秒)。所以我需要关闭自动过滤功能,并将过滤功能绑定(bind)到按钮点击。通过谷歌寻找答案没有结果。我该怎么做?请帮助我:)代码:和Controller:app.controller("smsCtrl",['$scope','smsData','createDialog','$http','$filter',function($scope,smsData,createDialog,$http,$filter){...} 最佳答案 我在帮助一位同事时遇到了

javascript - 在指令中观看 ng-model

我有以下指令:directive('myInput',function(){return{restrict:'AE',scope:{id:'@',label:'@',type:'@',value:'='},templateUrl:'directives/dc-input.html',link:function(scope,element,attrs){scope.disabled=attrs.hasOwnProperty('disabled');scope.required=attrs.hasOwnProperty('required');scope.pattern=attrs.pat

javascript - 在angularJS中使用工厂方法时未定义不是函数错误

我在寻找代码中TypeError:undefinedisnotafunction的解决方案时遇到问题。我有以下app.js:varapp=angular.module('test',['ngRoute','test.services','test.directives','test.controllers']);app.config(function($routeProvider,$httpProvider,$locationProvider){$locationProvider.html5Mode(true);$routeProvider.when('/q/:q',{template

javascript - 使用 $http 在 AngularJS 中调用 cURL

我是Angular的新手,我想在我的header中传递一个访问token,但我似乎做对了。我有一个工作正常的curl请求,我正试图让它以Angular工作:curlhttp://localhost:3000/api/v1/users-IH"Authorization:Tokenapi_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxx"无法正常工作的Angular$http调用$http.get('http://localhost:3000/api/v1/users',{headers:{'api_key':'xxxxxxxxxxxxxxxxxxxxxxxxxxxx'}}

javascript - 如何让 angularJS $watch 检测样式的变化?

我有一个包含所有样式控件的富文本框。当我在其中输入新文本时-它会保存。当我对内容(文本)以及颜色突出显示和粗体文本等样式进行任何更改时,它会保存更改的文本和样式。但是,当我只更改样式而不更改任何内容时-它不会保存这些样式更改。我正在使用$watch来比较新值和旧值。如何让它在样式更改时也能正常工作? 最佳答案 angular.module("app",[]).directive('spyStyle',[function(){return{link:function(scope,element,attrs){scope.$watch(